#coding=utf-8
from django.conf.urls.defaults import *
from django.views.generic import list_detail
from models import users

user_info = {
    "queryset" : users.objects.all().order_by("-id"),
    #"template_name" : "users/users_list.html",
    "paginate_by":8,
}

user_detail_info = {
    "queryset" : users.objects.all(),
    "template_object_name" : "user_info",
}

urlpatterns = patterns('',
    (r'^/?$', list_detail.object_list,user_info),
    (r'^list/$', list_detail.object_list,user_info),
    (r'^list/page(?P<page>[0-9]+)/$', list_detail.object_list,user_info),
    (r'^detail/(?P<object_id>\d+)/$',list_detail.object_detail,user_detail_info),
    (r'^add/$','users.views.users_add'),
    (r'^modify/(?P<id>\d+)/$','users.views.users_modify'),
    (r'^delete/(?P<id>\d+)/$','users.views.users_delete'),
    (r'^delete/$','users.views.users_delete'),
    
    (r'^myprofile/$','users.views.myprofile'),
    (r'^myprofile/edit','users.views.edit_myprofile'),
)